package easycloud.ecs.service;

import java.io.File;

import org.apache.commons.io.monitor.FileAlterationListenerAdaptor;

public class FileAlternationListener extends FileAlterationListenerAdaptor {

	public enum ALTERNATION {
		CHANGE, CREATE, DELETE
	}

	private MonitorService monitorService;

	public FileAlternationListener(MonitorService service) {
		monitorService = service;
	}

	@Override
	public void onDirectoryChange(File file) {
		// monitorService.addAlternationFile(file, ALTERNATION.CHANGE, false);
	}

	@Override
	public void onDirectoryCreate(File file) {
		// monitorService.addAlternationFile(file, ALTERNATION.CREATE, false);
	}

	@Override
	public void onDirectoryDelete(File file) {
		// monitorService.addAlternationFile(file, ALTERNATION.DELETE, false);
	}

	@Override
	public void onFileChange(File file) {
		monitorService.addAlternationFile(file, ALTERNATION.CHANGE, false);
	}

	@Override
	public void onFileCreate(File file) {
		monitorService.addAlternationFile(file, ALTERNATION.CREATE, false);
	}

	@Override
	public void onFileDelete(File file) {
		monitorService.addAlternationFile(file, ALTERNATION.DELETE, false);
	}

}
